# coding=utf-8
#================================================================
#   Copyright (C) 2020 * Ltd. All rights reserved.
#
#   File name   : cutechart.py
#   Author      : ZouZheKang-1996
#   Created date: 2020-08-14 18:15:51
#   Description : XuQingQing,I really ❤ U！
#
#================================================================

#折线图

from cutecharts.charts import Line
chart = Line("某商场销售情况")
chart.set_options(
    labels=["衬衫", "毛衣", "领带", "裤子", "风衣", "高跟鞋", "袜子"], 
    x_label="I'm xlabel", 
    y_label="I'm ylabel",
)
chart.add_series("series-A", [57, 134, 137, 129, 145, 60, 49])
chart.add_series("series-B", [114, 55, 27, 101, 125, 27, 105])
chart.render('chart.html')
# chart.render_notebook()

#柱状图

from cutecharts.charts import Bar

def bar_base() -> Bar:
    chart = Bar("TF-Boys身高")    
    chart.set_options(labels=["王俊凯", "易烊千玺", "王源"], x_label="I'm xlabel", y_label="I'm ylabel",y_tick_count = 50) 
    chart.add_series("series-A", [172, 169, 161]) 
    return chart

# bar_base().render_notebook()
bar_base().render('bar.html')

#饼图

from cutecharts.charts import Pie

def pie_base() -> Pie:
    chart = Pie("Pie-基本示例")
    chart.set_options(labels=["华为", "三星", "苹果"],legend_pos="upRight", inner_radius=0.5)
    chart.add_series([122, 134, 20])
    return chart

# pie_base().render_notebook()
pie_base().render('pie.html')

#雷达图

from cutecharts.charts import Radar
from cutecharts.faker import Faker

def radar_base() -> Radar:
    chart = Radar("Radar-基本示例")
    chart.set_options(labels=["价格", "质量", "续航","信仰","刷新率","性能","外观"],colors=['#ff9900', '#00ff00', '#cc00ff'],legend_pos="upRight")
    chart.add_series("华为",[60, 32, 72, 145, 111, 133, 133])
    chart.add_series("三星",[118, 58, 129, 107, 21, 150, 66])
    chart.add_series("苹果",[129, 125, 31, 113, 66, 99, 86])
    return chart

# radar_base().render_notebook()
radar_base().render('radar.html')